<?php

class sfGuardRegisterForm extends BasesfGuardRegisterForm
{
  public function configure()
  {
    $this->useFields(array(
      'email_address', 'password', 'password_again', 'username', 
      'affiliate_id', 'inviter_id'
    ));
    $this->setWidget('affiliate_id', new sfWidgetFormInputHidden());
    $this->setWidget('inviter_id', new sfWidgetFormInputHidden());
    $request = sfContext::getInstance()->getRequest();
    $this->setDefault('affiliate_id', $request->getParameter('affiliate_id'))
      ->setDefault('inviter_id', $request->getParameter('inviter_id'));
    $this->setWidget('agreement', new sfWidgetFormInputCheckBox(array(
      'value_attribute_value' => true
    )));
    $this->setValidator('agreement', new sfValidatorChoice(array(
      'choices' => array(true)
    )));
  }

  public function doSave($conn = null)
  {
    return parent::doSave($conn);
  }
}
